<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<div>
    <span> 请输入消费金额</span>
    <input type="text" id="money">
    <div>
        <p> 是否参加优惠换购活动:</p>
        <ol>
            <li>满50元, 加2元换购百事可乐一瓶</li>
            <li>满100, 加3元换购</li>
            <li>满100, 加10元换购</li>
            <li>满200, 加10元换购一个锅</li>
            <li>满200, 加20元换购2个锅</li>
            <li> 不换购</li>
        </ol>
        <p> 请选择: <input type="text" id="s"></p>
        <button id="btn"> 计算</button>
    </div>
</div>
<script>
var moneyInput = document.getElementById("money");
var s = document.getElementById("s");
var btn = document.getElementById("btn");
btn.onclick = function (){
    var money = +moneyInput.value;
    var num = +s.value;
    var msg = "本次消费金额:" + money + "\n";
    if(num == 1){
        if(money >= 50){
            msg += "满50元, 加2元换购百事可乐一瓶"
        }else{
            msg += "不够换购金额"
        }
    } else if(num == 2){
        if(money >= 100){
            msg += "满100, 加3元换购"
        }else{
            msg += "不够换购金额"
        }
    }
    
    alert(msg);
    
}
</script>
</body>

</html>